package cn.edu.cupk.factorymethod.fruit;

public class Factory {
    public static Car getFruitInstanceByType(String fruitTypeName){
        Car instanceOfCarReturned = null;
        if ( fruitTypeName.equalsIgnoreCase("宝马") ){
            instanceOfCarReturned = new BMWEntity();
        }else if (fruitTypeName.equals("法拉利")){
            instanceOfCarReturned = new BenChiEntity();
        } else if (fruitTypeName.equals("奔驰")) {
            instanceOfCarReturned = new FLLEntity();
        }
        return instanceOfCarReturned;
    }
}
